import { getItem,setItem } from '@/utils/storage'
import { LANG } from '@/constant'
export default {
    namespaced: true, // 表示单独的模块
    state: () => ({
        sidebarOpened: true, // Sidebar动画
        language: getItem(LANG) || 'zh'
    }),
    mutations: {
        // sidebar 设置左边伸展
        triggerSidebarOpened(state) {
            state.sidebarOpened = !state.sidebarOpened
        },
        // 切换国际化语言
        setLanguage(state,lang) {
            setItem(LANG, lang) // 存储到本地
            state.language = lang
        }
    },
    actions: {}
}